/*
 * Copyright(c) 2018 优居科技 All rights reserved.
 * distributed with this file and available online at
 * http://www.yjyz.com/
 */
package com.binc.testspring.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.binc.testspring.common.excel.TimeFormatConfig;
import com.binc.testspring.common.convert.easyExcel.TimeMillisFormatConverter;
import com.binc.testspring.common.serializer.IdToStringSerialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
// import com.sun.istack.internal.NotNull;
import com.sun.istack.internal.NotNull;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Tolerate;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 导出的实体类
 *
 *
 * 设置首行行高
 *      @HeadRowHeight((short) 50)
 * 不出现在excel中
 *      @ExcelIgnore
 * 出现在excel中
 *       @ExcelProperty(value = "交易时间", converter = TimeMillisFormatConverter.class)
 *
 * id转字符串（long类型数字长超出js上线）
 *      @JsonSerialize(using = IdToStringSerialize.class,index = 2)   文件列排序按照index排，如果没有写index就按照属性定义顺序
 *
 * 自定以注解，
 *     @TimeFormatConfig
 * easyExcel 自定义时间格式化器，   重写默认的一些实现规则
 *     @ExcelProperty(value = "交易时间", converter = TimeMillisFormatConverter.class)
 * 数字格式化
 *     @NumberFormat("##,###.##")
 *
 * 自定义注解，字典翻译！
 *     @DictConf
 *     @DictCode(prop = "interBank", conts = InnerBankEnum.class)
 *
 *    调节行高   列宽  字体 等等都有注解  这个后续单独百度即可

 */
@Data
// @DictConf
@HeadRowHeight((short) 50)
@Builder  //用这个的时候，最好时加个东西  （手动改加一个无参构造器，并且用@@Tolerate）
public class FundNhouseTransFlowVo implements Serializable {


    @JsonSerialize(using = IdToStringSerialize.class)
    @ExcelIgnore
    private Long id;


    @NotNull
    @JsonSerialize(using = IdToStringSerialize.class)
    @ExcelIgnore
    private Long tenantId;


    @JsonSerialize(using = IdToStringSerialize.class)
    @TimeFormatConfig
    @ExcelProperty(value = "交易时间", converter = TimeMillisFormatConverter.class,index = 2)
    private Long createTm;


    @JsonSerialize(using = IdToStringSerialize.class)
    @ExcelProperty(value = "交易系统流水号",index = 1)
    @NumberFormat("#")
    private Long tradeNo;


    @NotNull
    @JsonSerialize(using = IdToStringSerialize.class)
    @ExcelIgnore
    private Long orderId;

    /**
     * 第三方交易单号
     */
    @ExcelIgnore
    private String trnuid;

    /**
     * 收支类型，1.收入，2支出
     */
    @ExcelIgnore
    private Integer budgetType;

    @ExcelProperty("收支类型")
    private String budgetTypeStr;


    /**
     * 字典：nhouse_transflow_tran_type
     * 对应常量：PayCoreConstant
     * 垫佣/新房需求 50开始  50-垫佣款，51-垫佣手续费，52-新房存款，53-资方打款
     */
    @ExcelIgnore
    private Integer tranType;

    @ExcelProperty(value = "交易类型",index = 0)
    private String tranTypeStr;


    @JsonSerialize(using = IdToStringSerialize.class)
    @ExcelIgnore
    private Long accountId;

    /**
     * 账户类型,字典配置：1品牌，2分公司,3经纪公司
     */
    @ExcelIgnore
    private Integer accountType;

    /**
     * 转账交易类型,只有转账有值，字典配置：1转账，2提现，3收款手续费
     */
    @ExcelIgnore
    private Integer transferTranType;

    @ExcelProperty("是否同行交易")
    // @DictCode(prop = "interBank", conts = InnerBankEnum.class)
    private String interBankStr;

    @ExcelIgnore
    @ExcelProperty("转账手续费(元)")
    @NumberFormat("##,###.##")
    private java.math.BigDecimal fee;

    /**
     * 金额
     */
    @ExcelProperty("交易金额(元)")
    @NumberFormat("##,###.##")
    private java.math.BigDecimal amount;

    @ExcelIgnore
    private Integer interBank;

    @ExcelProperty("商户余额(元)")
    @NumberFormat("##,###.##")
    // @ExcelIgnore
    private java.math.BigDecimal merchantAmount;

    @ExcelIgnore
    @ExcelProperty("账户类型")
    private String customAccountType = "商户";

    @ExcelProperty("商户名称")
    private String merchantName;

    @JsonSerialize(using = IdToStringSerialize.class)
    @ExcelProperty("商户ID")
    @NumberFormat("#")
    private Long merchantId;


    /**
     * 对方开户行名称
     */
    @ExcelProperty("对方银行")
    private String accttoBank;

    // @Length(max = 64)
    @ExcelProperty("对方开户行")
    private String accttoBankdesc;

    /**
     * 对方开户行城市
     */
    // @ExcelIgnore
    @ExcelProperty("对方开户行城市")
    private String accttoCity;

    /**
     * 对方账号
     */
    @ExcelProperty("对方账号")
    private String accttoAcctid;

    /**
     * 对方账户姓名
     */
    @ExcelProperty("对方账户")
    private String accttoName;


    @ExcelIgnore
    private Integer payStatus;

    @JsonSerialize(using = IdToStringSerialize.class)
    @ExcelIgnore
    private Long tradeTm;

    // @ExcelIgnore
    @ExcelProperty("用款用途")
    private String purpose;

    @ExcelProperty("备注")
    private String remark;

    // @NotNull
    @ExcelIgnore
    private Date lastUpdateTm;

    @ExcelIgnore
    private List<Long> channelIds;

    @ExcelIgnore
    private Long channelId;

    @ExcelIgnore
    private String channelName;

    @ExcelIgnore
    private Long cityCode;

    @Tolerate
    public FundNhouseTransFlowVo() {
    }
}
